<template>
    <div>
        <el-table :data="tableData" border header-align="right" :header-cell-style="{ background: '#f2f6fc' }"
            header-cell-class-name="center" cell-class-name="center" empty-text="暂无数据">
            <el-table-column prop="orderSn" label="订单编号" />
            <el-table-column label="发货单流水号">
                暂无
            </el-table-column>
            <el-table-column prop="memberUsername" label="用户账号" />
            <el-table-column prop="payType" label="支付方式">
                <template #default="{ row }">
                    <span>{{ row.payType === 1 ? '支付宝' : '微信' }}</span>
                </template>
            </el-table-column>
            <el-table-column prop="address" label="订单来源">
                <template #default="{ row }">
                    <span>{{ orderSource(row.sourceType) }}</span>
                </template>
            </el-table-column>
            <el-table-column prop="address" label="订单类型">
                <template #default="{ row }">
                    <span>{{ row.orderType === 0 ? '正常订单' : "秒杀订单" }}</span>
                </template>
            </el-table-column>
        </el-table>
        <el-table :data="tableData" border header-align="right" :header-cell-style="{ background: '#f2f6fc' }"
            header-cell-class-name="center" cell-class-name="center" empty-text="暂无数据">
            <el-table-column prop="deliveryCompany" label="配送方式">
                <template #default="{ row }">
                    <span>{{ row.deliveryCompany ? row.deliveryCompany : '暂无' }}</span>
                </template>
            </el-table-column>
            <el-table-column prop="deliverySn" label="物流单号">
                <template #default="{ row }">
                    <span>{{ row.deliverySn ? row.deliverySn : '暂无' }}</span>
                </template>
            </el-table-column>
            <el-table-column prop="autoConfirmDay" label="自动收货时间">
                <template #default="{ row }">
                    <span>{{ row.autoConfirmDay + '天' }}</span>
                </template>
            </el-table-column>
            <el-table-column prop="growth" label="订单可得优币" />
            <el-table-column prop="integration" label="订单可得值" />
            <el-table-column label="活动信息">
                <template #default="{ row }">
                    <el-tooltip class="boxItem" effect="light" placement="top-start">
                        <template #content>
                            <div style="width: 200px;">
                                <p style="font-size: 18px;margin:10px 0;">活动信息</p>
                                <p style="font-size: 14px;margin-bottom: 10px;">{{ row.promotionInfo }}</p>
                            </div>
                        </template>
                        <span>{{ row.promotionInfo }}</span>
                    </el-tooltip>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script setup lang="ts">
import { orderSource } from "@/utils/orderStates"
const props = defineProps({
    tableData: {
        type: Array,
        default: []
    }
})
</script>

<style scoped>

</style>